package org.example.ws;

import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.socket.WebSocketHandler;

import java.util.Map;

public class ChatSessionInterceptor extends AbsChatSessionInterceptor {
    @Override
    protected Object getUser(ServerHttpRequest request) {
        return this.toHttp(request).getParameter("username");
    }

    @Override
    protected boolean beforeHandshakeInternal(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
        return true;
    }

    @Override
    protected void afterHandshakeInternal() {

    }
}
